package tblLSListner;

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import pnlBeheer.PnlMenuBeheer;

public class TMSLMenu implements ListSelectionListener {

	private PnlMenuBeheer pnlMenuBeheer;



	public TMSLMenu(PnlMenuBeheer pnlMenuBeheer) {
		this.pnlMenuBeheer = pnlMenuBeheer;
	}

	@Override
	public void valueChanged(ListSelectionEvent e) {
			if (!e.getValueIsAdjusting()) {
				String naam;
				int row = pnlMenuBeheer.getTblMenu().getSelectedRow();
				naam = (String) pnlMenuBeheer.getTblMenu().getValueAt(row, 0);
				
				System.out.println(naam);
				
				String SCatNaam = String.valueOf(naam);
				pnlMenuBeheer.getTxtNaam().setText(SCatNaam);
			
			}
	}}